#ifndef PCG_SYMHASH_H
#define PCG_SYMHASH_H

#define SYMHASH_SIZE 128
#define SYMHASH_MASK 127

typedef struct _pcg_sym_t {
	int hashv;
	char *name;
	int arity;
	void *data;
	
	struct _pcg_sym_t *next;
} pcg_sym_t;

typedef struct _pcg_symtab_t {
	pcg_sym_t *table[SYMHASH_SIZE];
	int count;
} pcg_symtab_t;

pcg_symtab_t *pcg_symtab_create();
void pcg_symtab_delete(pcg_symtab_t *st);

void pcg_symtab_insert_symbol(pcg_symtab_t *st, char *name, int arity, void *user_data);
pcg_sym_t *pcg_symtab_lookup(pcg_symtab_t *st, char *name, int arity);

#endif // PCG_SYMHASH_H